//
// Created by Administrator on 2022/6/16.
//

#ifndef RAPIDSVN_WIN_MYDIALOG_H
#define RAPIDSVN_WIN_MYDIALOG_H

#include "wx/wx.h"
#include "wx/app.h"
#include "NotificationIcon.h"

class WorkThread;
class GetHostInfo;

class MyDialog: public wxFrame {
public:
    explicit MyDialog( wxWindow *parent = nullptr );
    ~MyDialog() override;

protected:
    wxMenuBar* m_menubar1;
    wxMenu* m_menu1;
    wxStaticBitmap* bitmap_running;
    wxStaticText* static_response_time;
    wxScrolledWindow* scrolled_clients_window;
    wxStatusBar* m_statusBar1;
    wxCheckBox* m_checkBox_backup;
    wxCheckBox * m_checkBox_thread_pause;
    wxBoxSizer* scroll_window_sizer;
    wxStaticBoxSizer* clients_static_box_sizer;

    NotificationIcon* notification;

    wxStaticText * static_pid_datetime;
    wxStaticText * static_pid;
    wxStaticText * static_cpu;
    wxStaticText * static_proc_mem;
    wxStaticText * static_proc_virtual_mem;
private:
    void OnActionEvent( wxCommandEvent &event );
    void OnTimer( wxTimerEvent& event );
    void OnClose(wxCloseEvent& event);
    void OnExit( wxCommandEvent &event );
    void OnBackupLineClick( wxMouseEvent& event );
    void OnWorkThreadPause( wxMouseEvent& event );
    void OnOption( wxCommandEvent &event );
    void OnOpenRepository( wxCommandEvent &event );
    WorkThread* mThread;

    void BuildMenu();
    void BuildMainView();

    void BuildHostItemView( GetHostInfo* p );

    wxVector<std::shared_ptr<GetHostInfo>> infos;
DECLARE_EVENT_TABLE()
};


#endif //RAPIDSVN_WIN_MYDIALOG_H
